<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
      <!-- 添加和修改 -->
      <c:if test="${param.params != 'view'}">
          <div class="panel-body"> 
	       <form class="form-horizontal" id="defaultForm" action="" method="post">
			  	
			  	<input type="hidden" value="1" id="flag" name="flag"/>	
			  	
			  	<input type="hidden" id="productId" value="${t.id }">
			  	<input type="hidden" id="status" value="${t.status }">
			  	<input type="hidden" id="creator" value="${t.creator }">
			  	<input type="hidden" id="creationTime" value="${t.creationTime }">
			  	<input type="hidden" id="sku" value="${t.sku }">
                <!-- 状态  创建者  创建时间 -->
			  	
			  	<div class="form-group">
				    <label class="col-sm-offset-1 col-sm-2 control-label">商品名称：</label>
				    <div class="col-sm-2">
						<input type="text" class="form-control" id="name" placeholder="请输入商品名称" value="${t.name}" onchange="checkName('name')">
						<div class="check" style="color:#a94442;font-size:85%"><span class="checkMsg"></span></div>
				    </div>
				    
				    <label class="col-sm-offset-1 col-sm-2 control-label">商品型号：</label>
				    <div class="col-sm-2">
						<input type="text" class="form-control" id="model" placeholder="请输入商品型号" value="${t.model}" onchange="checkName('model')">
				        <div class="check" style="color:#a94442;font-size:85%"><span class="checkMsg"></span></div>
				    </div>
				 </div>
				
				  
				 <div class="form-group">
					 <label class="col-sm-offset-1 col-sm-2 control-label" id="categoryNameMng">4级类别：</label>
				     <div class="col-sm-2">
		                <input class="form-control" type="text" id="categoryName" readonly="readonly" value="${t.category.name }" onchange="checkName('categoryName')">
		                <input type="hidden" id="categoryId" value="${t.category.id}">
				     </div>
				     <div class="col-sm-1"></div>
				     
				     <label class="col-sm-2 control-label" id="seriesNameMng">选择系列：</label>
				     <div class="col-sm-2">
		                <input class="form-control" type="text" id="seriesName" readonly="readonly" value="${t.productSeries.name }" onchange="checkName('seriesName')">
		                <input type="hidden" id="seriesId" value="${t.productSeries.id}">
		                <div class="check" style="color:#a94442;font-size:85%"><span class="checkMsg"></span></div>
				     </div>
				     <div class="col-sm-1">
		                <input class="form-control" type="button" value="选择系列" onclick="choose('series')">
				     </div>
			     </div>
			     
			     <div class="form-group">
					 <label class="col-sm-offset-1 col-sm-2 control-label" id="brandShowNameMng">品牌名称：</label>
				     <div class="col-sm-2">
		                <input class="form-control" type="text" id="brandShowName" readonly="readonly" value="${t.brandShow.name }" onchange="checkName('brandShowName')">
		                <input type="hidden" id="brandShowId" value="${t.brandShow.id}">
				     </div>
				     <div class="col-sm-1"></div>
				     
				     <label class="col-sm-2 control-label" id="productIntroductionNameMng">选择详情：</label>
				     <div class="col-sm-2">
		                <input class="form-control" type="text" id="productIntroductionName" readonly="readonly" value="${t.productIntroduction.name }" onchange="checkName('productIntroductionName')">
		                <input type="hidden" id="productIntroductionId" value="${t.productIntroduction.id}">
		                <div class="check" style="color:#a94442;font-size:85%"><span class="checkMsg"></span></div>
				     </div>
				     <div class="col-sm-1">
		                <input class="form-control" type="button" value="选择详情" onclick="choose('productIntroduction')">
				     </div>
			     </div>
			     
			     <div class="form-group">
				    <label class="col-sm-offset-1 col-sm-2 control-label">商品来源：</label>
				    <div class="col-sm-2">
				        <input type="text" class="form-control" id="infoSourceShow" readonly="readonly" value="">
						<input type="hidden" id="infoSource" value="${t.infoSource}">
				        <div class="check" style="color:#a94442;font-size:85%"><span class="checkMsg"></span></div>
				    </div>
				 </div>
			     
			     
			     <div class="form-group">
					 <label class="col-sm-offset-1 col-sm-2 control-label">选择图片：</label>
			     </div>
			     
			     <!-- 修改时显示的图片在这里循环 -->
				  <c:if test="${!empty method}" >
				  	<c:forEach items="${t.productPicList }" varStatus="status" var="pics" >
				  		<div id="picFrameDivOriginal${status.count }" class="form-group">
				  			<label class="col-sm-offset-1 col-sm-2 control-label"></label>
			  				<div class="col-sm-2">
			  					<img src="${pics.path }" style="padding:2px; border:1px solid; margin-bottom:10px;width:200px;height:200px;">
		  						<input value="${pics.id }" type="hidden" name="productPicIds">
		  						<div class="check" style="color:#a94442;font-size:85%"><span class="checkMsg"></span></div>
		  					</div>
		  					<div class="col-sm-1">
		  					    <input class="form-control" type="button" value="删除图片" onclick="deleteChoosePic('picFrameDivOriginal${status.count }',this)">
		  					</div>
			  			</div>
				  	</c:forEach>
				  </c:if>
			     
			     <div id="choosePicBtnDiv" class="form-group">
					 <label class="col-sm-offset-1 col-sm-2 control-label"></label>
				     <div class="col-sm-2">
			               <input class="form-control" type="button" value="选择图片" onclick="choose('productPic')">
				     </div>
			     </div>
			     
			     <div class="form-group">
				    <div class="col-sm-offset-5 col-sm-7">
				      <input type="button" class="btn btn-default" onclick="submitForm(1)" value="保存">
				      <input type="button" class="btn btn-default" onclick="nextPage(2)" value="下一步">
				    </div>
				 </div>
	  
			</form>
		</div>
		</c:if>
		
		<!-- 查看 -->
		<c:if test="${param.params == 'view'}">
		<div class="panel-body"> 
	       <form class="form-horizontal" id="defaultForm" action="" method="post">
			  	<div class="form-group">
				    <label class="col-sm-offset-1 col-sm-2 control-label">商品名称：</label>
				    <div class="col-sm-2">
						<input type="text" class="form-control" id="name" value="${t.name}" readonly="readonly">
				    </div>
				    
				    <label class="col-sm-offset-1 col-sm-2 control-label">商品型号：</label>
				    <div class="col-sm-2">
						<input type="text" class="form-control" id="model" value="${t.model}" readonly="readonly">
				    </div>
				 </div>
				
				  
				 <div class="form-group">
					 <label class="col-sm-offset-1 col-sm-2 control-label" id="categoryNameMng">4级类别：</label>
				     <div class="col-sm-2">
		                <input class="form-control" type="text" id="categoryName" readonly="readonly" value="${t.category.name }">
				     </div>
				     
				     <div class="col-sm-1"></div>
				     
				     <label class="col-sm-2 control-label" id="seriesNameMng">系列名称：</label>
				     <div class="col-sm-2">
		                <input class="form-control" type="text" id="seriesName" readonly="readonly" value="${t.productSeries.name }">
				     </div>
			     </div>
			     
			     <div class="form-group">
					 <label class="col-sm-offset-1 col-sm-2 control-label" id="brandShowNameMng">品牌名称：</label>
				     <div class="col-sm-2">
		                <input class="form-control" type="text" id="brandShowName" readonly="readonly" value="${t.brandShow.name }">
				     </div>

				     <div class="col-sm-1"></div>
				     
				     <label class="col-sm-2 control-label" id="productIntroductionNameMng">详情名称：</label>
				     <div class="col-sm-2">
		                <input class="form-control" type="text" id="productIntroductionName" readonly="readonly" value="${t.productIntroduction.name }">
				        <input type="hidden" id="productIntroductionId" value="${t.productIntroduction.id}">
				     </div>
			     </div>
			     
			     
			     <div class="form-group">
				    <label class="col-sm-offset-1 col-sm-2 control-label">商品来源：</label>
				    <div class="col-sm-2">
				        <input type="text" class="form-control" id="infoSourceShow" readonly="readonly" value="">
						<input type="hidden" id="infoSource" value="${t.infoSource}">
				    </div>
				 </div>
			     
			     
			     <div class="form-group">
					 <label class="col-sm-offset-1 col-sm-2 control-label">图片展示：</label>
			     </div>

			  	<c:forEach items="${t.productPicList }" varStatus="status" var="pics" >
			  		<div id="picFrameDivOriginal${status.count }" class="form-group">
			  			<label class="col-sm-offset-1 col-sm-2 control-label"></label>
		  				<div class="col-sm-2">
		  					<img src="${pics.path }" style="padding:2px; border:1px solid; margin-bottom:10px;width:200px;height:200px;">
	  						<input value="${pics.id }" type="hidden" name="productPicIds">
	  					</div>
		  			</div>
			  	</c:forEach>
			</form>
		</div>
	</c:if>